

package com.cmcc.pcap.packet.sctp.nas.impl.ies;


import com.cmcc.pcap.packet.sctp.nas.core.ies.InformationElement4;
import com.cmcc.pcap.packet.sctp.nas.utils.OctetInputStream;
import com.cmcc.pcap.packet.sctp.nas.utils.OctetOutputStream;
import com.cmcc.pcap.packet.sctp.nas.utils.octets.Octet;

public class IEGprsTimer2 extends InformationElement4 {
    public Octet value;

    public IEGprsTimer2() {
    }

    public IEGprsTimer2(Octet value) {
        this.value = value;
    }

    public IEGprsTimer2(int value) {
        this(new Octet(value));
    }

    public boolean hasValue() {
        return value.intValue() != 0;
    }

    @Override
    protected IEGprsTimer2 decodeIE4(OctetInputStream stream, int length) {
        IEGprsTimer2 res = new IEGprsTimer2();
        res.value = stream.readOctet();
        return res;
    }

    @Override
    public void encodeIE4(OctetOutputStream stream) {
        stream.writeOctet(value);
    }
}
